package net.airuima.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Table;
import net.airuima.domain.base.CustomBaseEntity;
import org.hibernate.annotations.*;

import jakarta.persistence.*;
import jakarta.validation.constraints.*;
import org.hibernate.annotations.Cache;

import java.io.Serializable;
import java.time.*;
import java.util.Objects;

/**
 * Copyright (C), 2017-2023, 武汉睿码智能科技有限公司
 * Domain
 *
 * @author ruima
 * @date 2024-02-06
 */
@Schema(description = "")
@Entity
@Table(name = "demo")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@DynamicInsert
@DynamicUpdate
public class Demo extends CustomBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 名称
     */
    @Schema(description = "名称")
    @Column(name = "name")
    private String name;

    /**
     * 工作
     */
    @Schema(description = "工作")
    @Column(name = "work")
    private String work;


    public String getName() {
        return name;
    }

    public Demo setName(String name) {
        this.name = name;
        return this;
    }

    public String getWork() {
        return work;
    }

    public Demo setWork(String work) {
        this.work = work;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Demo demo = (Demo) o;
        if (demo.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), demo.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

}
